package cn.com.yiqi.wsc.dao.order;

import cn.com.yiqi.wsc.Ro.CartVO;
import cn.com.yiqi.wsc.Ro.MainOrderVo;
import cn.com.yiqi.wsc.Ro.OrderDetailVo;
import cn.com.yiqi.wsc.dao.order.criteria.OrderRecordCriteria;
import cn.com.yiqi.wsc.entity.order.OrderMain;
import cn.com.yiqi.wsc.entity.order.OrderMainExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface OrderMainMapper {


    int deleteByPrimaryKey(Integer id);

    int insertSelective(OrderMain record);

    List<OrderMain> selectByExample(OrderMainExample example);

    OrderMain selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(OrderMain record);

    List<MainOrderVo> findOrderDetails(@Param("userId") Integer userId, @Param("orderState") Integer orderState);

    OrderDetailVo findOrderDetailByOrderId(Integer id);

    void updateOrderAddress(@Param("addressId") Integer addressId, @Param("id") Integer id);

    Integer sumCanPoint(Integer orderId);

    OrderMain findOrder(@Param("userId") Integer userId, @Param("orderId") Integer orderId);

    OrderMain selectByorderCode(String outTradeNo);

    List<OrderMain> selectOrderDetail(OrderRecordCriteria orderRecordCriteria);

    List<OrderMain> findOrderWaitToPay(Integer min);

    List<OrderMain> findOrdersByPid(Integer pid);

    List<OrderDetailVo> findOrderDetailSons(@Param("userId") Integer userId, @Param("orderState")Integer orderState);

    void updateOrderAndOrderSonState(@Param("state") Integer state, @Param("id")Integer id);

    List<CartVO> findVartVosByOrderId(Integer orderId);

    List<OrderMain> findOrderToComfirm(Integer hours);
}